package com.cn.design.factory.simple;

/**
 * @author xuhui
 * @Description:
 * @date 2022-06-29 18:58
 **/
public class Client {

    //1.new的方式
    public static void main(String[] args) {
        //需要了解接口和对应的实现类
        Phone xiaomi = new MiPhone();
        Phone apple = new IPhone();




        // 2.工厂创建，无需关注细节
        Phone miPhone = PhoneFactory.makePhone("MiPhone");
        // make iphone!
        IPhone iPhone = (IPhone) PhoneFactory.makePhone("iPhone");
    }
}
